package nc.ui.bf.jx.raterule;

import java.util.List;

import nc.itf.trade.excelimport.IImportableEditor;
import nc.itf.trade.excelimport.ImportableInfo;
import nc.ui.bd.pub.AbstractBdBillCardUI;
import nc.ui.pub.ClientEnvironment;
import nc.ui.pub.bill.BillEditEvent;
import nc.ui.trade.bill.ICardController;
import nc.ui.trade.card.CardEventHandler;
import nc.ui.trade.excelimport.InputItem;
import nc.vo.scm.pub.session.ClientLink;

public class ClientUI extends AbstractBdBillCardUI implements IImportableEditor {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	ClientLink cl = new ClientLink(ClientEnvironment.getInstance());

	public ImportableInfo getImportableInfo() {
		return null;
	}

	public ClientUI() {
		super();
	}

	public void addNew() {
	}

	public void setValue(Object obj) {

	}

	public void save() throws Exception {
	}

	public void cancel() {

	}

	@Override
	public Object getUserObject() {
		return new RateLimitCheck();
	}

	public List<InputItem> getInputItems() {
		return null;
	}

	@Override
	protected ICardController createController() {
		return new RateRuleController();
	}

	@Override
	protected CardEventHandler createEventHandler() {
		return new RateRuleEventHandler(this, getUIControl());
	}

	@Override
	public String getRefBillType() {
		return null;
	}

	@Override
	public void setDefaultData() throws Exception {

	}

	@Override
	public boolean beforeEdit(BillEditEvent e) {
		int row = e.getRow();
		String key = e.getKey();
		String pk_raterule = null;
		pk_raterule = (String) getBillCardPanel().getBodyValueAt(row,
				"pk_raterule");
		if (pk_raterule != null) {
			if ("deffectivedate".equalsIgnoreCase(key)) {
				return false;
			}
		}
		return true;
	}

}
